LOCal

Syntax: LOCal var1 {, var [(index {indexi} )] }
Location: QL ROM

This command must only be used as the first executable line within either a PROCedure or FuNction definition block (ie. it can only be preceded by REMark lines)

LOCal must be followed by a list of variables which are said to be 'local' to that definition block. This means that although a variable may already have been used within the main body of the program, if it is local to that definition block, on entry its value is stored and it is then made 'unset' (without value), and can then be used for any means within that definition block (or within any sub-procedure or sub-function called by that definition block). When the definition block is left (with END DEFine or RETurn), the variable is restored to its original value.

Arrays can also be made LOCal by placing an index after their name, which is used to specify their size (as with DIM). Indeed this is the only way in which a simple variable can also be used as an array.

CROSS-REFERENCE:
DIM sets up arrays normally.
DEFine PROCedure, DEFine FuNction and END DEFine are used to identify definition blocks.
